package pers.vic.dubbo.consumer.service;

import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;
import pers.vic.dubbo.common.api.DubboDemoService;
import pers.vic.dubbo.common.model.VicModel;

import javax.annotation.PostConstruct;
import java.util.List;

/**
 * 描述:
 * @author Vic.xu
 * @date 2021-12-30 11:17
 */
@Service
public class ConsumerTestService implements DubboDemoService{

    @DubboReference(version = "1.0.0", check=false)
    private DubboDemoService dubboDemoService;

    @PostConstruct
    private void post(){

    }



    public void test(){
        int id = 112;
        VicModel model = dubboDemoService.findById(id);
        System.out.println(model);

    }

    @Override
    public VicModel findById(Integer id) {
        return dubboDemoService.findById(id);
    }

    @Override
    public List<VicModel> findList() {
        return dubboDemoService.findList();
    }

    @Override
    public int deleteById(Integer id) {
        return dubboDemoService.deleteById(id);
    }
}
